package com.springbootsecuritydemo.controller;

import com.springbootsecuritydemo.service.impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 测试控制层
 * @author Daft_V
 * @date 2022/4/6 10:22
 */
@Controller
public class TestController {

    @GetMapping("/test01")
    @ResponseBody
    @PreAuthorize("hasAuthority('system:test01')")
    public String test01(){
        return "test01";
    }

    @GetMapping("/test04")
    @ResponseBody
    @PreAuthorize("hasAuthority('system:test04')")
    public String test04(){
        return "test04";
    }

    @GetMapping("/test03")
    @ResponseBody
    @PreAuthorize("hasAuthority('system:test03')")
    public String test03(){
        return "test03";
    }

}
